package com.example.androidcomplete0102.ch17;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class CalAct extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		Intent intent = getIntent();
		int leftValue = intent.getIntExtra("leftValue", 0);
		int rightValue = intent.getIntExtra("rightValue", 0);
		
		int res = leftValue * rightValue;
		
		intent.putExtra("Result", Integer.toString(res));
		setResult(RESULT_OK, intent);
		finish();
	}
}
